<template>
  <div id="app">
    <router-view @login="loginDirect" @logout="logoutDirect" />
  </div>
</template>


<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import Cookie from "js-cookie";
// import login from './api/login';
import { buildMenu, deepcopy } from "@/utils/commonUtils";

import { fullRoutes } from "@/routes/routes";

@Component({
  components: {},
  computed: {}
})
export default class App extends Vue {
  private menuTree: any = null;

  private userData: any = null;

  protected created() {
    this.signin();
  }

  private getPermission(userInfo: any) {}

  private setInterceptor(resourcePermission: any) {}

  private getRoutes(userInfo: any) {
    
  }

  /**
   * signin
   */
  public signin(callback?: () => void, data?: any) {
    let user = Cookie.get("console_token");


  }

  // 登录后重定向页面
  private loginDirect({
    newPath,
    data
  }: {
    newPath?: string;
    data?: any;
  }): void {
    // 123456789
    this.$router.push(newPath || 'Home/ActivityList');
    this.signin(() => {}, data);
  }

  private logoutDirect() {
    sessionStorage.removeItem("token");
  }
}
</script>


<style lang="less">
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
#nav {
  padding: 30px;
  a {
    font-weight: bold;
    color: #2c3e50;
    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
